<include file="Public/header"/> 
<include file="Public/sidebar"/>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        编辑分类
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
        <li class="active">Here</li>
      </ol>
    </section>
    <!-- Main content -->
    <section class="content">

        <div class="box ">
            <!-- /.box-header -->
            <!-- form start -->
            <form action="{:U('Admin/Category/edit')}" class="form-horizontal" method="post" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$data['id']}">
              <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-1 control-label">上级分类</label>
                    <div class="col-sm-10">
                      <select class="form-control" name="pid">
                        <option value="0">顶级分类</option>
                        <foreach name="nav" item="v">
                        <option value="{$v.id}" <?php if($data['pid'] == $v['id']) {echo 'selected="selected"' ;}?>>{$v['_name']}</option>
                        </foreach>
                      </select>
                    </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">名称</label>
                  <div class="col-sm-10">
                    <input type="text" name="name" value="{$data['name']}" class="form-control" placeholder="名称">
                  </div>
                </div>

                <empty name="thumb">
                <div class="form-group">
                  <label class="col-sm-1 control-label">缩略图</label>
                  <div class="col-sm-10">
                    <input type="file" name="thumb" class="form-control">
                  </div>
                </div>
                <else />
                <div class="form-group">            
                    <label class="col-sm-1 control-label">缩略图</label>
                    <img src="__ROOT__/upload/{$thumb}" class="col-sm-2 img-responsive" alt="" width="120" height="100">
                    <a class="col-sm-1 control-label" href="{:U('Admin/Category/delthumb',array('id'=>$data['id']))}"><button type="button" class="btn btn-success">删除该图</button></a>
                </div>
                </empty> 

                <div class="form-group">
                  <label class="col-sm-1 control-label">描述</label>
                  <div class="col-sm-10">
                  <textarea name="description" class="form-control" rows="3" placeholder="描述 ...">{$data['description']}</textarea>
                  </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">类型</label>
                    <div class="col-sm-10">
                      <select class="form-control" name="type">
                        <option value="1">type1</option>
                        <option value="2">type2</option>
                      </select>
                    </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">是否展示</label>
                  <div class="col-sm-10">
                    <span>是</span>
                    <input type="radio" name="show_nav" value="1" <if condition="$data.show_nav eq 1">checked="checked"</if>>
                        &emsp;
                    <span>否</span>
                    <input type="radio" name="show_nav" value="0" <if condition="$data.show_nav eq 0">checked="checked"</if>>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">排序</label>
                  <div class="col-sm-10">
                    <input type="text" name="order_number" value="{$data['order_number']}" class="form-control" placeholder="排序">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">seo标题</label>
                  <div class="col-sm-10">
                    <input type="text" name="seo_title" value="{$data['seo_title']}" class="form-control" placeholder="seo标题">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">seo关键词</label>
                  <div class="col-sm-10">
                    <input type="text" name="seo_keywords" value="{$data['seo_keywords']}" class="form-control" placeholder="seo关键词">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-1 control-label">seo描述</label>
                  <div class="col-sm-10">
                  <textarea name="seo_description" value="{$data['seo_description']}" class="form-control" rows="3" placeholder="描述 ..."></textarea>
                  </div>
                </div>
              </div>
              <!-- /.box-body -->
              <div class="box-footer">
                <a href="{:U('Admin/Category/index')}"><button type="button" class="btn btn-success">返回</button></a>
                <button type="submit" class="btn btn-success">修改</button>
              </div>
              <!-- /.box-footer -->
            </form>
        </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
<include file="Public/footer"/>
<script>

</script>